Happy Path ^^^^^ **Definition:** * A test that uses known input, which executes without exception and produces an expected output. **Code Example:** .. code-block:: @Test public void shouldProcessPacket() throws IOException, ServletException { //given given(request.getParameter(PacketApi.PACKET_PARAMETER)) .willReturn(PACKET); given(request.getParameter(PacketApi.TYPE_PARAMETER)) .willReturn(TYPE); //when servlet.doGet(request, response); //then verify(packetDataProcessor).process(PACKET, TYPE); } **References:** .. admonition:: Quality attributes * :octicon:`file-code;1em` - Code Example * :octicon:`comment-discussion;1em` - Cause and Effect * :octicon:`graph;1em` - Frequency * :octicon:`sync;1em` - Refactoring * `Anti-Patterns - Digital Tapestry `_ * `Bad tests, good tests `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` :octicon:`sync;1em` * `Categorising Test Smells `_ :octicon:`graph;1em` * `Improving Student Testing Practices through a Lightweight Checklist Intervention. `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` :octicon:`graph;1em` * `Smells in software test code: A survey of knowledge in industry and academia `_ * `Unit Testing Anti-Patterns, Full List `_ * `Unit testing Anti-patterns catalogue `_